<?php
class Model_DbTable_Support extends Apps_Db_Table_Abstract {
	protected $_name = 'support';

	const STATUS_ACTIVE 	= 1;
	const STATUS_INACTIVE 	= 0;

	const TYPE_YAHOO = 1;
	const TYPE_SKYPE = 2;
	const TYPE_PHONE = 3;

	public function getList() {
		$q = $this->_db
				  ->select()
				  ->from('support', null)
				  ->where('status =?', self::STATUS_ACTIVE)
				  ->columns(array('id'				=> 'support.id',
				  				  'type'			=> 'support.type',
				  				  'account'			=> 'support.account',
				 				  'supporter_name'	=> 'support.supporter_name'));
 		return $q;
	}

	public function getListBySupportType($type) {
		$q = $this->_db
				  ->select()
				  ->from('support', null)
				  ->where('type = ?', $type)
				  ->where('status =?', self::STATUS_ACTIVE)
				  ->columns(array('id'				=> 'support.id',
				  				  'type'			=> 'support.type',
				  				  'account'			=> 'support.account',
				 				  'supporter_name'	=> 'support.supporter_name'));
 		return $q;
	}
}